package jdk.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPoolDemo {
	
	
	public static void main(String[] args) {
		
		int coreNumber = Runtime.getRuntime().availableProcessors();
		
		ExecutorService fixedThreadPool = Executors.newFixedThreadPool(1);
		
		for(int i=0; i<100; i++) {
			fixedThreadPool.execute(new Runnable() {
				
				public void run() {
					System.out.println(Thread.currentThread().getName());					
				}
			});
		}
		
		fixedThreadPool.shutdown();
		
	}

}
